//
//  UserManager.h
//  ChangChat
//
//  Created by Cocoa on 2019/9/2.
//  Copyright © 2019 yibai. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "User.h"
#import "FriendItem.h"
#import "GroupItem.h"
#import "Address_groupItem.h"

@class SessionItem;

#define kUsermanager [UserManager shareManager]

NS_ASSUME_NONNULL_BEGIN

@interface UserManager : NSObject

@property (nonatomic, strong, nullable) SessionItem *currentSession;
@property (nonatomic, assign, readonly) BOOL isLogin;
@property (nonatomic, strong) User *me;
@property (nonatomic, strong) NSMutableArray *friendArray;
@property (nonatomic, strong) NSMutableArray *friend_groupArray;
@property (nonatomic, strong) NSMutableArray *groupChatArray;
@property (nonatomic, strong, readonly) UIFont *msgFont;
///  小 中 大
@property (nonatomic, copy) NSString *msgFontSize;
+ (instancetype)shareManager;
- (void)clean;
- (void)saveUserWithInfo:(NSDictionary *)info;

- (void)updateUserInfo;
- (void)updateFriendList;
- (void)updateChatDBPath;
- (void)updateFriend_groupList;
- (void)updateGroupChatList;

- (void)getFriendWithUserId:(NSString *)uid groupId:(NSString *)groupId callbackBlock:(void(^)(FriendItem *friendItem))complete;
- (void)getGroupWithGroupId:(NSString *)groupId callbackBlock:(void(^)(GroupItem *item))complete;
- (void)getGroupInfoWithGroupId:(NSString *)groupId needUpdate:(BOOL)update callbackBlock:(void(^)(GroupItem *item))complete;

@end

NS_ASSUME_NONNULL_END
